﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using CNFM_CROCODILE_LOGO.Core.Domain.ViewModels;
using CNFM_CROCODILE_LOGO.Services.Interfaces;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace CNFM_CROCODILE_LOGO_WebApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class SignageController : ControllerBase
    {
        private ISignageWXServices _pro;

        public SignageController(ISignageWXServices pro)
        {
            this._pro = pro;
        }

        /// <summary>
        /// 标识申请列表
        /// </summary>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <param name="status"></param>
        /// <param name="sasearch"></param>
        /// <returns></returns>
        [HttpGet("GetSignageApplicationAll")]
        [Authorize("Permission")]
        public IActionResult GetSignageApplicationAll(int index, int size, string status, string sasearch)
        {
            var ret = _pro.GetSignageApplicationAll(index, size, status, sasearch);
            return Ok(ret);
        }

        /// <summary>
        /// 标识申请单详情
        /// </summary>
        /// <param name="signagId"></param>
        /// <returns></returns>
        [HttpGet("GetSignageApplication")]
        [Authorize("Permission")]
        public IActionResult GetSignageApplication(string signagId)
        {
            var ret = _pro.GetSignageApplication(signagId);
            return Ok(ret);
        }

        /// <summary>
        /// 标识申请单新增修改
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        [HttpPost("AddUpdateSignageApplication")]
        [Authorize("Permission")]
        public IActionResult AddUpdateSignageApplication(SignageApplicationReceiptModels model)
        {
            var ret = _pro.AddUpdateSignageApplication(model);
            return Ok(ret);
        }

    }
}